﻿@model MovieReview.DataModels.Movie
@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<div>
    <table class="table-bordered">
        <tr>
            <th>Movie Poster</th>
            <th>Movie Title</th>
            <th>Movie Rating</th>
        </tr>
        <tr>
            <td style="height:100px;width:100px;"><img class="img-responsive" src="@Model.Image" /></td>
            <td>@Model.Title</td>
            <td>
                @if (@Model.Rating == 1)
                {
                    <div>&#9733&#9734&#9734&#9734&#9734</div><br />
                }
                else if (@Model.Rating == 2)
                {
                    <div>&#9733&#9733&#9734&#9734&#9734</div><br />
                }
                else if (@Model.Rating == 3)
                {
                    <div>&#9733&#9733&#9733&#9734&#9734</div><br />
                }
                else if (@Model.Rating == 4)
                {
                    <div>&#9733&#9733&#9733&#9733&#9734</div><br />
                }
                else if (@Model.Rating == 5)
                {
                    <div>&#9733&#9733&#9733&#9733&#9733</div><br />
                }
                else if (@Model.Rating == 0)
                {
                    <div>&#9734&#9734&#9734&#9734&#9734</div><br />
                }
            </td>
        </tr>
    </table>
    <button class="btn btn-warning" onclick="location.href='/Home/Edit/@Model.Id'">Edit</button>
    <button class="btn btn-danger" onclick="location.href='/Home/Delete/@Model.Id'">Delete</button>
</div>